import {View, Text, StyleSheet, AlertType, Platform, AlertIOS, Alert} from 'react-native'
import React, {Component} from 'react'
import {IS_IOS} from "../../style/constant";

export enum AlertButtonStyle {
    destructive = "destructive",
    default = "default",
    cancel = "cancel"
}

export interface AlertProxyBtn {
    text: string
    onPress?: () => void
    style?: AlertButtonStyle
}


export  function alertProxy(title: string, content?: string, buttons?: AlertProxyBtn[], alertType?: AlertType) {
    if (IS_IOS) {
        AlertIOS.alert(title, content, buttons, alertType);
    } else {
        Alert.alert(title, content, buttons, {cancelable: false}, alertType)
    }
}
